﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using GalaSoft.MvvmLight;
using MaterialDesignThemes.Wpf;
using ZFSDomain.Common.UserControls;
using ZFSDomain.Interface.Base;
using ZFSDomain.Interface.User;
using ZFSDomain.SysModule;

namespace ZFSDomain.ViewDialog.User
{
    /// <summary>
    /// 添加用户
    /// </summary>
    public class SearchUserDlg : BaseViewDialog<SearchUserWindow>, ISelectUserDialog
    {
        public override void BindViewModel<TViewModel>(TViewModel viewModel)
        {
            var dialog = GetDialog();
            (dialog as Window).DataContext = viewModel;
        }

        public override Task<bool> ShowDialog(DialogOpenedEventHandler openedEventHandler, DialogClosingEventHandler closingEventHandler)
        {
            var dialog = GetDialog();
            (dialog as Window).ShowDialog();
            var r = ((dialog as Window).DataContext as BaseDialogOperation).Result;
            return Task.FromResult(r);
        }

    }
}
